<html>
<head><meta charset="utf-8"><title>visit body of function from external crate · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/visit.20body.20of.20function.20from.20external.20crate.html">visit body of function from external crate</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="136956319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/visit%20body%20of%20function%20from%20external%20crate/near/136956319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nora <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/visit.20body.20of.20function.20from.20external.20crate.html#136956319">(Nov 01 2018 at 23:09)</a>:</h4>
<p>I want to check if there is an unsafe block in the body of a function from an external crate. I have the DefId of the function. <br>
If the function is local, then I can get the NodeId and the body and visit it. I can get it from the MIR source_scope_local_data. But neither of these work if the function is not local. <br>
How can I do it?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>